package com.toolmanrln.common.config;

import org.dozer.DozerBeanMapper;
import org.dozer.Mapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.ResourceUtils;

import java.util.Arrays;

/**
 * @author ToolMan.RLN
 * @since 2020-05-14 18:01
 */
@Configuration
public class DozerConfig {

    /**
     * 转换器配置
     */
    @Bean(name = "dozerBeanMapper")
    public Mapper mapper() {
        Mapper mapper = new DozerBeanMapper(Arrays.asList(ResourceUtils.CLASSPATH_URL_PREFIX + "dozer/dozerBeanMapping.xml"));
        return mapper;
    }
}
